package org.knight.gearbox.repository;


import org.knight.gearbox.model.entity.UserRole;
import org.knight.gearbox.security.AccessAware;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface UserRoleRepository extends CrudRepository<UserRole,Long> {


    @Query("select r from UserRole r where r.userId = :#{#aa.userId}  and r.buId = :#{#aa.buId}")
    List<UserRole> findUserRolesByUserIdAndBuId(@Param("aa") AccessAware accessAware);
}
